﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
using System.Data;

namespace DuncanDAL
{
    public class UserDataService : IDAL<T_UserObject>
    {
        public const string SQL_SELECT_T_USER = "select * from T_User";

        #region IDAL<T_UserObject> 成员

        public void Create(T_UserObject obj)
        {
            throw new NotImplementedException();
        }

        public void Delete(T_UserObject obj)
        {
            throw new NotImplementedException();
        }

        public void Update(T_UserObject obj)
        {
            throw new NotImplementedException();
        }

        public IList<T_UserObject> QueryAll()
        {
            IList<T_UserObject> list = new List<T_UserObject>();
            DataTable dtT_User = new DataTable("T_User");
            DBHelper.FillData(SQL_SELECT_T_USER, dtT_User);
            foreach (DataRow item in dtT_User.Rows)
            {
                T_UserObject o = new T_UserObject();
                o.Data2Object(item);
                list.Add(o);
            }
            return list;
        }

        public T_UserObject Get(object id)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
